if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[v_tb_posscorecashback]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[v_tb_posscorecashback]
GO

/****** Object:  View [dbo].[v_tb_posscorecashback]    Script Date: 10/17/2017 17:12:48 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO




create  view [dbo].[v_tb_posscorecashback]
as

SELECT     cast(0 as bit) choice,m.bid m_bid, m.bkind m_bkind, m.bstate m_bstate, m.bcode m_bcode, m.bdate m_bdate, m.filid m_filid, m.empid m_empid, m.create_by m_create_by,m.deptid m_deptid, m.voucherid m_voucherid, m.remark m_remark, m.sflag m_sflag,m.custom1 m_custom1,m.custom2 m_custom2,m.custom3 m_custom3,m.custom4 m_custom4,m.custom5 m_custom5,
m.custom6 m_custom6,m.custom7 m_custom7,m.custom8 m_custom8,m.custom9 m_custom9,m.custom10 m_custom10,
m.custom11 m_custom11,m.custom12 m_custom12,m.custom13 m_custom13,m.custom14 m_custom14,m.custom15 m_custom15, d.*
FROM tb_posscorecashback m left JOIN
tb_posscorecashbackdtl d ON m.bid = d.bid
GO


